const String HTTPBLOCK =
    'finished:(void(^)(BOOL isSuccessed,id result,NSString* codeType,NSString* errorMessage))finished';

const String HTTPBLOCK_RAC =
    'finished:^(BOOL isSuccessed, id  _Nonnull result, NSString * _Nonnull codeType, NSString * _Nonnull errorMessage)';

class SLHTTPMethod {
  static const String GET = 'GET';
  static const String POST = 'POST';
}

const String sl_doc_RACCommand_h = '''
#import <Foundation/Foundation.h>
#import <ReactiveObjC/ReactiveObjC.h>
#import "[IN_NAME_MANAGER].h"

/*
typedef NS_ENUM(NSUInteger, [IN_NAME]Code) {
    [IN_NAME]Code_NO = 0
};
*/


NS_ASSUME_NONNULL_BEGIN

/// @date [DATE]
/// @author generate
@interface [IN_NAME] :NSObject
/// {@"code":@(0),@"msg":@""}
@property (nonatomic, strong) RACSubject *messageSubject;
@property (nonatomic, strong) RACCommand *requestCommand;
@property (nonatomic, strong) [IN_NAME_MANAGER] *[IN_NAME_MANAGER_NAME];
[IN_PROPERTY]
@end

NS_ASSUME_NONNULL_END
''';

const String sl_doc_RACCommand_m = '''
#import "[IN_NAME].h"

@interface [IN_NAME]()
@end

@implementation [IN_NAME]
#pragma mark - Init
-(instancetype)init{
    if (self = [super init]) {
        NSLog(@"%s",__func__);
        [self racInit];
    }
    return self;
}

-(void)dealloc {
    NSLog(@"%s",__func__);
    [self.requestCommand rac_deallocDisposable];
    [self.messageSubject rac_deallocDisposable];
[VM_IM_PROPERTY_DIS]
}

- (void)racInit {
    [self seg_requestCommand];
[VM_IM_CMD_USE]
}

#pragma mark - Publish Methods

#pragma mark - Private Methods
/// show message
-(void)seg_showMessage:(NSString*)msg code:(NSInteger)code{
    [self.messageSubject sendNext:@{@"code":@(code),@"msg":msg}];
}

-(void)seg_requestCommand{
    //@weakify(self);
    _requestCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal * _Nonnull(id  _Nullable input) {
        return [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber>  _Nonnull subscriber) {
            //@strongify(self);
            
            // Code here...
            // [subscriber sendNext:nil];
            // [subscriber sendCompleted];

            // NSError *error = [NSError errorWithDomain:NSCocoaErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:@"error!"}];
            // [subscriber sendError:error];            
            return [RACDisposable disposableWithBlock:^{
            }];
        }];
    }];
}
[VM_IM_CMD]

#pragma mark - Getter
-(RACSubject *)messageSubject{
    if (!_messageSubject) {
        _messageSubject = [RACSubject subject];
    }
    return _messageSubject;
}

-([IN_NAME_MANAGER] *)[IN_NAME_MANAGER_NAME]{
    if (!_[IN_NAME_MANAGER_NAME]) {
        _[IN_NAME_MANAGER_NAME] = [[[IN_NAME_MANAGER] alloc]init];
    }
    return _[IN_NAME_MANAGER_NAME];
}
#pragma mark - Stter
@end
''';
